#include <gmodule.h>

#include "main.h"

G_MODULE_EXPORT void plugin_connect()
{

}

G_MODULE_EXPORT gboolean plugin_create_tab(const NotebookAction* action, NotebookPluginTab* tab)
{
	
	g_printf("plugin_create_tab called\n");
	tab->header_type = NHT_STANDARD;
	tab->header_data.title = "Hello World";
	tab->page = gtk_label_new("My awesome tab created from a plugin");
	return TRUE;
}

G_MODULE_EXPORT NotebookPluginInfo* plugin_get_info()
{
	gtk_init(0, NULL);

	NotebookPluginInfo *info = g_malloc0(sizeof(NotebookPluginInfo));
	g_assert(info);
	
	info->guid = guid_create("BF1CAC0E-4878-4F50-9399-F29AEA3A5452");
	info->name = "Awesome Plugin";
	info->author = "Aly Hirani";
	info->desc = "This is an awesome plugin";
	
	g_printf("plugin_get_info called\n");
	
	return info;
}

G_MODULE_EXPORT void plugin_destroy_info(NotebookPluginInfo *info)
{
	g_assert(info);
	g_assert(info->guid);
	
	guid_free((GUID*)info->guid);
	
	g_printf("plugin_destroy_info called\n");
	
	g_free(info);
}
